﻿var xmlHTTP=false;
function GetChapterContent(chapterUrl)
{

    if(window.XMLHttpRequest)
    {   
         xmlHTTP=new XMLHttpRequest();   
    }
    else
    {   
         if(window.ActiveXObject)
         {   
                try
                {   
                    xmlHTTP=new ActiveXObject("Microsoft.XMLHTTP");            
                }   
                catch(e)
                {
                    try
                    {
                        xmlHTTP=new ActiveXObject("Msxml2.XMLHTTP");
                    }
                    catch(e2)
                    {
                        xmlHTTP=new XMLHttpRequest();
                    }
                }   
               
          } 
     }
     
     if(xmlHTTP)
     {   
        xmlHTTP.onreadystatechange=ShowChapterContent;   
        xmlHTTP.open("GET",chapterUrl,true);   
        xmlHTTP.setRequestHeader("TIYMAAJAX-Ver", "ver1.0");
		xmlHTTP.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHTTP.send(null);

     }
     else
     {   
        alert("不能发送ajax请求");   
     }  
 }  
  
function ShowChapterContent()
{
    if(xmlHTTP.readyState==4)
    {   
        if(xmlHTTP.status==200)
        {   
           alert(xmlHTTP.responseText);
        }
        else
        {   
           alert("ajax读取页面内容失败!");
        }   
      
    }  
}



